<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;
            height: 300px;
            border: 1px solid pink;
            margin: 50px auto;
            position: relative;
        }
        .item{
            width: 100px;
            height: 100px;
        }
        .item1{
            position: absolute;
            top: 30px;
            left: 40px;
            /* z-index的值越大，层叠越高。如果取值相同，则元素后者覆盖前者 */
            z-index: 1;
            background-color: skyblue;
        }
        .item2{
            position: absolute;
            top: 90px;
            left: 90px;
            background-color: brown;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item item1"></div>
        <div class="item item2"></div>
    </div>
</body>
</html>